

{% extends 'base.html' %}
{% load static %}
{% block title %}管理{% endblock %}
{% block css %}<link href="{% static 'login.css' %}" rel="stylesheet"/>{% endblock %}


{% block content %}



<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>编辑</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            background-color: #f2f2f2;
            margin: 0;
            padding: 0;
        }

        .container {
            max-width: 500px;
            margin: 20px auto;
            border: 1px solid #ccc;
            padding: 20px;
            background-color: #fff;
        }

        form {
            width: 100%;
        }

        table {
            width: 100%;
        }

        th, td {
            padding: 8px;
        }

        th {
            text-align: left;
        }

        input[type="submit"] {
            padding: 10px 20px;
            background-color: #4caf50;
            color: #fff;
            border: none;
            border-radius: 4px;
            cursor: pointer;
        }

        input[type="submit"]:hover {
            background-color: #45a049;
        }
    </style>
</head>
<body>
<div class="container">
<form method="post" action="../edit/">
    {% if message %}
        <div class="alert alert-warning">{{ message }}</div>
    {% endif %}
<a href="../initial">返回主页</a>
    {% csrf_token %}
    <input type="hidden" name="id" value="{{ movies.movieID }}"/>
    <table>
        <tr>
            <th>id</th>
            <td><input name="movieID" value="{{ movies.movieID }}"></td>
        </tr>
        <tr>
            <th>电影名称</th>
            <td><input name="moviename" value="{{ movies.moviename }}"></td>
        </tr>
        <tr>
            <th>演员</th>
            <td><input name="actors" value="{{ movies.actors }}"></td>
        </tr>
        <tr>
            <th>导演</th>
            <td><input name="director" value="{{ movies.director }}"></td>
        </tr>
        <tr>
            <th>介绍</th>
            <td><input name="introduction" value="{{ movies.introduction }}"></td>
        </tr>
        <tr>
            <td colspan="2">
                <input type="submit" class="submit-btn" value="保存"/>
            </td>
        </tr>
    </table>
    {% if messages %}
        <script>
            {% for msg in messages %}
                alert('{{ msg.message }}');
            {% endfor %}
        </script>
    {% endif %}
</form>
</div>
</body>
</html>

{% endblock %}